Date_default_timezone_get (): Gets the current time zone of PHP date_default_timezone_set (): Sets the current time zone for PHPDate ("Y-m-d h-i-s")time (): Returns the current timestamp (1970-1-1--to date) unit seconds
strtotime (): Converts the
Self-summary, what is not satisfied with the place, you can help correct the supplement, thank you!Purpose: SimpleDateFormat class can be a very casual combination of date and time format, more than simply yyyy-mm-dd this formatNonsense not much to
Programmers who write Php+mysql know there is a time difference, UNIX timestamp and format date are two time representations we often deal with, Unix timestamp storage, processing convenient, but not intuitive, format date intuitive, but not as easy
Date instruction Related Usage exampleDate usage: date [OPTION] ... [+format]Date [-u|--utc|--universal] [MMDDHHMM[[CC]YY][.SS]]Enter Date directlyDate specified format display time: Date +%y_%m_%d, date +%y:%m:%dDate can be used to display or set
1, Date object turn timestamp current_day2, calculates the incremental timestamp, which is the increment of the loop per step one_day3, loop body calculation, date variable plus increment re-assign value4, time stamp back to date format
Date instruction Related Usage exampleDate usage: date [OPTION] ... [+format]Date [-u|--utc|--universal] [MMDDHHMM[[CC]YY][.SS]]Enter Date directlyDate specified format display time: Date +%y_%m_%d, date +%y:%m:%dDate can be used to display or set
PHP gets today, yesterday, last week, this month's start time stamp and end time stamp method, mainly uses in the PHP time function mktime. Let's start with an example of how to use Mktime to get the start time stamp and end time stamp for today,
Copy Code code as follows:
PHP gets today start timestamp and end time stamp
$beginToday =mktime (0,0,0,date (' m '), date (' d '), date (' Y '));
$endToday =mktime (0,0,0,date (' m '), date (' d ') +1,date (' Y '))-1;
PHP gets
PHP gets constellation information and zodiac information based on date or time stamp, PHP constellation
Share a function method that uses PHP to obtain the corresponding Ganzhi, Zodiac, and constellation information based on date or time stamp,
For ease of application, you may need to add a date/time stamp to each record to determine when each record is added. In an Access database application, the now () function can be used to easily accomplish this task. This article is a step-by-step
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.